package com.group02.community.entity.user;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.group02.community.entity.dept.SysDept;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_user")
public class SysUser {

  @TableId(type = IdType.AUTO)
  @ExcelProperty("用户编号")
  private long userId;

  @ExcelProperty("部门id")
  private long deptId;

  @ExcelProperty("用户名称")
  private String userName;

  @ExcelProperty("用户昵称")
  private String nickName;

  @ExcelProperty("用户类型")
  private String userType;

  @ExcelProperty("用户邮箱")
  private String email;

  @ExcelProperty("用户电话")
  private String phonenumber;

  @ExcelProperty("用户性别")
  private String sex;

  @ExcelProperty("头像地址")
  private String avatar;

  @ExcelProperty("用户密码")
  private String password;

  @ExcelProperty("用户状态")
  private String status;

  @ExcelProperty("是否删除")
  private String delFlag;


  private String loginIp;


  private LocalDateTime loginDate;


  private String createBy;


  @TableField(value = "create_time" ,fill = FieldFill.INSERT)
  private LocalDateTime createTime;


  private String updateBy;

  @TableField(value = "update_time" ,fill = FieldFill.INSERT_UPDATE)
  private LocalDateTime updateTime;


  private String remark;

  @TableField(exist = false)
  @ExcelIgnore
  private SysDept dept;

  @TableField(exist = false)
  @ExcelIgnore
  private List<Long> roleIds;
  @TableField(exist = false)
  @ExcelIgnore
  private List<Long> postIds;

}
